package com.mxchip.livestar.base;

import androidx.annotation.NonNull;

import com.videohigh.graham.Term;

public class SystemData {

    public static boolean globalIsAuth = true;

    public static boolean autoAnswer;

    private static Term myTerm;

    private static String deviceId;

    private static SystemData instance = new SystemData();

    private SystemData() {
    }

    public static SystemData getInstance() {
        return instance;
    }

    /**
     * 接收到来自无线投屏按键的指令
     */
    private boolean wifiResPub = false;

    public boolean getWifiResPub() {
        return wifiResPub;
    }

    public void setWifiResPub(boolean wifiResPub) {
        this.wifiResPub = wifiResPub;
    }


    public static int networkLevelStandard = 0;
    public static int networkLevelMiddle = 1;
    public static int networkLevelLower = 2;
    public static int networkLevelMinimum = 3;

    public static int standardBitRate = 1024 * 1024 * 3 / 2;
    public static int middleBitRate = (int) (1024 * 1024 * 0.8);
    public static int lowerBitRate = 1024 * 512;
    public static int minimumBitRate = (int) (1024 * 1024 * 0.3);

    public static int cameraStandardBitRate = 1024 * 500;
    public static int cameraMiddleBitRate = 1024 * 300;
    public static int cameraLowerBitRate = 1024 * 200;
    public static int cameraMinimumBitRate = 1024 * 100;

    public static void setMyTerm(Term myTerm) {
        SystemData.myTerm = myTerm;
    }

    public static void setDeviceId(String deviceId) {
        SystemData.deviceId = deviceId;
    }

    public static @NonNull String deviceId() {
        if(deviceId == null) {
            return "";
        }
        return deviceId;
    }

    public static @NonNull String userId() {
        if(myTerm == null) {
            return "";
        }
        return myTerm.getTermId();
    }


    public static @NonNull String roomId() {
        if(myTerm == null) {
            return "";
        }
        return myTerm.getRoomId();
    }

}
